﻿using Uniforax.Core.Common;
using Uniforax.Core.GameActions.Battle;
using Uniforax.Core.Skills;

namespace Uniforax.Camp.TestData.SmallStake
{
    ///<summary>小桩子的攻击。</summary>
    public class SmallStakeAttack : BaseSkill
    {
        public int Damage { get; set; } = 30;

        public override BaseSkillRange GetSkillRange()
        {
            return new SmallStakeAttackSkillRange();
        }

        public override void Effect(ActionContext context, SkillContext skillContext)
        {
            var world = context.GameWorld;
            var grid = world.GetGrid(skillContext.TargetPosId);
            var targetObject = grid.GetPlacedObject(skillContext.TargetObjectId);
            var damageAction = new DamageAction(targetObject) { Damage = Damage };
            context.History.Add(damageAction);
            damageAction.Execute(context);
        }
    }
}
